﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Racks data</title>
    <link rel="stylesheet" type="text/css" href="/css/main.css" />
    <link href="/css/smoothness/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
    <link href="jPicker/css/jPicker-1.1.6.min.css" rel="stylesheet" type="text/css" />


    <script type="text/javascript" language="javascript">
        if (typeof console == "undefined") {
            console = function () {
            };
            console.log = function (msg) {
            };
        }
    </script>
    <script src="/js/jquery-1.6.2.min.js" type="text/javascript"></script>
    <script src="/js/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
    <script src="js/jquery.actual.min.js" type="text/javascript"></script>
    <script src="js/jquery.form.js" type="text/javascript"></script>
    <script src="js/jquery.filestyle.mini.js" type="text/javascript"></script>
    <script src="js/jpicker-1.1.6.js" type="text/javascript"></script>

    <script src="js/colors.js" type="text/javascript"></script>
    <script src="js/dc.js" type="text/javascript"></script>
    <script src="js/vendor.js" type="text/javascript"></script>
    <script src="js/rack.js" type="text/javascript"></script>
    <script src="js/server.js" type="text/javascript"></script>
    <script src="js/iplist.js" type="text/javascript"></script>
    <script src="/js/page.js" type="text/javascript"></script>

</head>
<body>
<div id="tabs">
	<ul>
		<li><a href="#tab-overview">Overview</a></li>
        <li><a href="#tab-sheets">Sheets</a></li>
		<li><a href="#tab-reports">Reports</a></li>
		<li><a href="#tab-settings">Settings</a></li>
	</ul>
	<div id="tab-overview">
        <div id="infopanel" class="ui-widget-content"></div>
        <div id="menupanel" class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
			<a id="dc_edit" href="#" style="display:none">Edit mode</a><br />
			<a id="dc_add" href="#" style="display:none">Add</a>
		</div>
	</div>
	<div id="tab-sheets">
		<div id="sheets">
            <ul>
                <li><a href="#tab-datacenters">Datacenters</a></li>
                <li><a href="#tab-racks">Racks</a></li>
                <li><a href="#tab-servers">Servers</a></li>
            </ul>
            <div id="tab-datacenters">
                <a href="#" class="sheets_dc_reload">Reload</a>
                <a href="#" class="sheets_dc_add">Add</a>
                <a href="#" class="sheets_dc_export">Export</a>
                <table class="table">
                    <thead>
                        <tr>
                            <td>Name</td>
                            <td>Address</td>
                            <td>Power</td>
                            <td>Notes</td>
                            <td>...</td>
                            <td>...</td>
                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
                <a href="#" class="sheets_dc_reload">Reload</a>
                <a href="#" class="sheets_dc_add">Add</a>
                <a href="#" class="sheets_dc_export">Export</a>
            </div>
            <div id="tab-racks">
                <a href="#" class="sheets_rack_reload">Reload</a>
                <a href="#" class="sheets_rack_add">Add</a>
                <a href="#" class="sheets_rack_export">Export</a>
                <table class="table">
                    <thead>
                        <tr>
                            <td>Datacenter</td>
                            <td>Name</td>
                            <td>Vendor</td>
                            <td>Units</td>
                            <td>Notes</td>
                            <td>Responsible</td>
                            <td>...</td>
                            <td>...</td>
                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
                <a href="#" class="sheets_rack_reload">Reload</a>
                <a href="#" class="sheets_rack_add">Add</a>
                <a href="#" class="sheets_rack_export">Export</a>
            </div>
            <div id="tab-servers">
                <a href="#" class="sheets_server_reload">Reload</a>
                <a href="#" class="sheets_server_add">Add</a>
                <a href="#" class="sheets_server_export">Export</a>
                <table class="table">
                    <thead>
                        <tr>
                            <td>Datacenter</td>
                            <td>Rack</td>
                            <td>Name</td>
                            <td>Vendor</td>
                            <td>Model</td>
                            <td>Type</td>
                            <td>SN</td>
                            <td>IN</td>
                            <td>Pusage</td>
                            <td>Pstate</td>
                            <td>Units</td>
                            <td>IPs</td>
                            <td>Mgmtip</td>
                            <td>Notes</td>
                            <td>Responsible</td>
                            <td>...</td>
                            <td>...</td>
                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
                <a href="#" class="sheets_server_reload">Reload</a>
                <a href="#" class="sheets_server_add">Add</a>
                <a href="#" class="sheets_server_export">Export</a>
            </div>
        </div>
	</div>
	<div id="tab-reports">
		<div id="reports">
            <ul>
                <li><a href="#reports-ips">IPs</a></li>
            </ul>
            <div id="reports-ips">
                <a href="#" class="report_ips_reload">Reload</a>
                <a href="#" class="report_ips_export">Export</a>
                <table class="table">
                    <thead>
                        <tr>
                            <td>IP</td>
                            <td>Server</td>
                            <td>Rack</td>
                            <td>Datacenter</td>
                            <td>Switch Name</td>
                            <td>Switch Port</td>
                        </tr>
                    </thead>
                    <tbody></tbody>
                </table>
                <a href="#" class="report_ips_reload">Reload</a>
                <a href="#" class="report_ips_export">Export</a>
            </div>
        </div>
	</div>
    <div id="tab-settings">
        <div id="settings">
            <ul>
                <li><a href="#settings-import">Import</a></li>
            </ul>
            <div id="settings-import">
		        <h3>Import</h3>
		        <form id="import-form" class="ui-widget ui-widget-content ui-corner-all" action="/import.aspx" method="post" enctype="multipart/form-data">
		        <!-- <a id="A1" href="#" style="" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button"><span class="ui-button-text">Edit mode</span> </a> -->
		            <input type="hidden" name="empty" value="on" />
		            Datacenters: <input type="file" name="datacenters" /><br />
		            Racks: <input type="file" name="racks" /><br />
		            Servers: <input type="file" name="servers" /><br />
		            Vendors (optional): <input type="file" name="vendors" /><br />
		            <input type="submit" value="Import" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" />
		        </form>
		        <h3>File formats</h3>
		        <p>CSV-files with semicolon as delimiter. The first row must contain headers.</p>
                <p><span style="color:Red">Attention!</span> Semicolons are not allowed inside cells! Otherwise the file can be parsed uncorrectly.</p>
		        <p>If the &quot;Empty database&quot; option is turned off existing items (with the same name) will be overwritten.</p>
		        <h4>Datacenters</h4>
		        <p>Fields: name, address, power, notes. "Name" is required.</p>
		        <h4>Vendors (optional)</h4>
		        <p>Fields: name, color</p>
		        <h4>Racks</h4>
		        <p>Fields: dc_name, name, vendor, units, notes, responsible. "Dc_name", "name" and "units" are required. Combination of "dc_name" and "name" must be unique.</p>
		        <h4>Servers</h4>
		        <p>Fields: dc_name, rack_name, name, vendor, type, model, sn, in, pusage, pstate, units, ips, mgmtip, notes, color, responsible. "Dc_name", "rack_name", "name", "ips" and "units" are required.</p>
		        <p>Combination of "dc_name", "rack_name" and "name" must be unique.</p>
		        <p>"Units" must be presented as a number or as a range (bounds are included), eg. 24 or 24-25.</p>
		        <p>"Ips" must be formatted as comma-delimited list.</p>
		        <p>"Pstate" should be 1/0, True/False or On/Off. If this field is omitted, it will be treated as On.</p>
		        <p>"Pusage" must be number.</p>
		    </div>
        </div>
		
	</div>
    
</div>
<div id="dc_container"></div>
<div id="rack_info"></div>
<div class="tooltip" id="tooltip"><p></p></div>
<div id="dc_edit_form" title="Add new datacenter" style="display:none">
    <fieldset class="ui-widget ui-widget-content ui-corner-all">
        <input type="hidden" id="form_dc_id" name="id" />
        <table class="edittable">
            <tr>
                <td>Name</td><td><input type="text" id="form_dc_name" name="name" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
            <tr>
                <td>Address</td><td><input type="text" id="form_dc_address" name="address" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
            <tr>
                <td>Power</td><td><input type="text" id="form_dc_power" name="power" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
            <tr>
                <td>Notes</td><td><input type="text" id="form_dc_notes" name="notes" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
        </table>
    </fieldset>
</div>

<div id="rack_edit_form" title="Add new rack", style="display:none">
    <fieldset class="ui-widget ui-widget-content ui-corner-all">
        <input type="hidden" id="form_rack_id" name="id" />
        <table class="edittable">
            <tr>
                <td>Datacenter</td>
                <td>
                    <select id="form_rack_dc" name="">
                        <option value="0">--</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>Name</td><td><input type="text" id="form_rack_name" name="name" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
            <tr>
                <td>Vendor</td>
                <td>
                    <select id="form_rack_vendor" name="">
		                <option value="0">--</option>
	                </select>
                </td>
            </tr>
            <tr>
                <td>Units</td><td><input type="text" id="form_rack_units" name="units" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
            <tr>
                <td>Notes</td><td><input type="text" id="form_rack_notes" name="notes" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
            <tr>
                <td>Responsible</td><td><input type="text" id="form_rack_responsible" name="responsible" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
        </table>
    </fieldset>
</div>

<div id="server_edit_form" title="Add new server", style="display:none">
    <fieldset class="ui-widget ui-widget-content ui-corner-all">
        <input type="hidden" id="form_server_id" name="id" />
        <input type="hidden" id="form_server_rack_id" name="rack_id" />
        <table class="edittable">
            <tr>
                <td>Datacenter</td>
                <td>
                    <select id="form_server_dc" name="">
                        <option value="0">--</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>Rack</td>
                <td>
                    <select id="form_server_rack" name="">
                        <option value="0">--</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>Name</td><td><input type="text" id="form_server_name" name="name" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
            <tr>
                <td>Vendor</td>
                <td>
                    <select id="form_server_vendor" name="">
		                <option value="">--</option>
	                </select>
	            </td>
            </tr>
            <tr>
                <td>Model</td><td><input type="text" id="form_server_model" name="model" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
            <tr>
                <td>Type</td><td><input type="text" id="form_server_type" name="type" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
            <tr>
                <td>SN</td><td><input type="text" id="form_server_sn" name="sn" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
            <tr>
                <td>IN</td><td><input type="text" id="form_server_in" name="in" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
            <tr>
                <td>Pusage</td><td><input type="text" id="form_server_pusage" name="pusage" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
            <tr>
                <td>Pstate</td><td><input type="checkbox" id="form_server_pstate" name="pstate" class="ui-widget ui-widget-content ui-corner-all" checked /></td>
            </tr>
            <tr>
                <td>Units</td>
                <td>
                    <input type="text" id="form_server_units" name="units" class="ui-widget ui-widget-content ui-corner-all" style="width:70px" /> -
                    <input type="text" id="form_server_units2" name="units" class="ui-widget ui-widget-content ui-corner-all" style="width:70px" />
                </td>
            </tr>
            <tr>
                <td>Server IPs</td><td class="ui-widget ui-widget-content ui-corner-all"><input type="text" id="form_server_ip" name="ip" class="server_ip ui-widget ui-widget-content ui-corner-all" /><a href="#" id="form_server_add_ip"></a></td>
            </tr>
            <tr>
                <td>Management IP</td><td><input type="text" id="form_server_mgmtip" name="mgmtip" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
            <tr>
                <td>Notes</td><td><input type="text" id="form_server_notes" name="notes" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
            <tr>
                <td>Color</td><td><input type="text" id="form_server_color" name="color" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
            <tr>
                <td>Responsible</td><td><input type="text" id="form_server_responsible" name="responsible" class="ui-widget ui-widget-content ui-corner-all" /></td>
            </tr>
        </table>
    </fieldset>
</div>
<div id="ask_yes_no"></div>		
<div id="info" title="Information"></div>
<div id="err" style="color: Red; position:absolute"></div>
</body>
</html>
